package org.dromara.demo.domain;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonInclude;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.dromara.common.core.validate.EditGroup;

import java.io.Serial;

/**
 * 测试主从对象 test_demo2_line
 */
@Data
@ExcelIgnoreUnannotated
@TableName("demo_example2_line")
public class DemoExample2Line {

  @Serial
  private static final long serialVersionUID = 1L;

  @ExcelProperty(value = "父键")
  private Long id;

  @NotNull(message = "主键不能为空", groups = { EditGroup.class })
  @ExcelProperty(value = "主键")
  @TableId(value = "line_id")
  private Long lineId;

  @ExcelProperty(value = "名称")
  private String name;

  @ExcelProperty(value = "编码")
  @JsonInclude(JsonInclude.Include.NON_EMPTY)
  @TableField(exist = false)
  private String code;

}
